//
//  LLPresentattionController.swift
//  WeiBoShiBing
//
//  Created by Bingo on 15/11/10.
//  Copyright © 2015年 Bingo. All rights reserved.
//

import UIKit

class LLPresentattionController: UIPresentationController {
    
    
    override func containerViewWillLayoutSubviews() {
        
        super.containerViewDidLayoutSubviews()
        
        containerView?.backgroundColor = UIColor(white: 0, alpha: 0.2)
        
        let tap = UITapGestureRecognizer(target: self, action: "close")
        
        containerView?.addGestureRecognizer(tap)
        
        presentedView()?.frame = CGRect(x: 100, y: 56, width:200, height: 300)
    }
    
    func close(){
    
        presentedViewController.dismissViewControllerAnimated(true, completion: nil)
        
        NSNotificationCenter.defaultCenter().postNotificationName("PopoverDismiss", object:nil)
    }

}
